<?php

use common\helpers\Url;
use yii\grid\GridView;
use common\helpers\Html;

$this->title = '流程状态';
$this->params['breadcrumbs'][] = ['label' => $this->title];

?>

<div class="row">
    <div class="col-sm-12">
        <div class="nav-tabs-custom">
            <ul class="nav nav-tabs">
                <li ><a href="<?= Url::to(['edit', 'id' => 'notice']) ?>">基本信息</a></li>
                <li class="active"><a href="<?= Url::to(['status', 'id' => 'notice']) ?>">流程状态</a></li>
                <li><a href="<?= Url::to(['create']) ?>">工作流转</a></li>
                <li class="pull-right">
                    <?= Html::create(['status/ajax-edit', 'id' => $workflow_id], '创建', [
                        'data-toggle' => 'modal',
                        'data-target' => '#ajaxModalLg',
                    ]); ?>
                </li>
            </ul>
            <div class="tab-content">
                <div class="active tab-pane">
                    <?= GridView::widget([
                        'dataProvider' => $dataProvider,
                        'filterModel' => $searchModel,
                        //重新定义分页样式
                        'tableOptions' => ['class' => 'table table-hover'],
                        'columns' => [
                            [
                                'class' => 'yii\grid\SerialColumn',
                                'visible' => false, // 不显示#
                            ],
                            'id',
                            'workflow_id',
                            'label',
                            [
                                'headerOptions' => ['width' => '180'],
                                'header' => "操作",
                                'class' => 'yii\grid\ActionColumn',
                                'template'=> '{edit} {status} {delete}',
                                'buttons' => [
                                    'edit' => function ($url, $model, $key) {
                                        return Html::edit(['status/edit', 'id' => $model->id]);
                                    },
                                    'status' => function ($url, $model, $key) {
                                        return Html::status($model->status);
                                    },
                                    'delete' => function ($url, $model, $key) {
                                        return Html::delete(['status/hide', 'id' => $model->id]);
                                    },
                                ],
                            ],
                        ],
                    ]); ?>
                </div>
            </div>
        </div>
    </div>
</div>